<template>
  <el-dialog v-model="show" title="选择站点" class="rounded-[15px]" width="420">
    <div>
      <el-button v-for="p in siteList" :key="p.id" @click="loginThisSite(p)">{{ p.alias }}</el-button>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref } from "vue";
const show = ref(false);
const siteList = ref<any[]>([]);

const open = (list: any[]) => {
  siteList.value = list;
  show.value = true;
};

const emits = defineEmits(["login"]);

const loginThisSite = (p: any) => {
  emits("login", p.id);
};

const close = () => {
  show.value = false;
};

defineExpose({ open, close });
</script>

<style></style>
